#include <iostream>
using namespace std;

template<typename T, size_t N>
T Sum(const T(&arr)[N]) {
    T ret = 0;
    for (T item : arr) {
        ret += item;
    }
    return ret;
}

int main() {
    double a[] = {4.4, 3.2, 7.3, 6.8, 5.0};
    printf("%f\n", Sum(a)); // 特化出double Sum(double (&arr)[5]);
    int b[] = {3, 1, 9, 3};
    printf("%d\n", Sum(b)); //特化出int Sum(int (&arr)[4]);
    return 0;
}
